package dshop.model.job;

import java.util.Date;

import appbase.jfinal.ext.BaseModel;
import dshop.AppConst;

public class Job extends BaseModel<Job>{
	
	private static final long serialVersionUID = -6967680902549117464L;
	
	public static final Job dao = new Job();

	public static void delete(int jobId) 
	{
		new Job().set("is_delete", AppConst.DELETE_STR_YES)
		 		 .set("delete_date_time", new Date())
		 		 .set("id", jobId)
		 		 .update();
	}

	public static void setCheckStatus(int jobId, String checkStatus, String checkStatusExplain) 
	{
		new Job().set("check_status", checkStatus)
		 		 .set("check_status_explain", checkStatusExplain)
		 		 .set("check_date_time", new Date())
		 		 .set("id", jobId)
		 		 .update();
	}

	
	public static void setEnd(int jobId) 
	{
		dao.updateColumnBy("end_date_time", "id", new Date(), jobId);
	}
	
}
